import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
  base: "/",
  assetsDir: "assets",
  title: "doc-web",
  description: "前端知识点",
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    logo: "/assets/logo.svg",
    search: {
      provider: "local",
    },
    nav: [
      { text: "Home", link: "/" },
      { text: "每日一题", link: "/daily-question/js_20250920" },
      { text: "基础", link: "/html&css/interview" },
      { text: "框架", link: "/vue/base" },
      { text: "浏览器", link: "/web/base" },
      { text: "服务端", link: "/node/base" },
      { text: "面试记录", link: "/records/record1" },
    ],
    sidebar: [
      {
        text: "每日一题",
        collapsed: true,
        items: [
          {
            text: "vue",
            collapsed: true,
            items: [
              {
                text: "20250901_Vue 实例在挂载过程中发生了什么？",
                link: "/daily-question/vue_20250901",
              },
              {
                text: "20250902_什么是 Vue 的 nextTick？有什么作用？",
                link: "/daily-question/vue_20250902",
              },
              {
                text: "20250903_vue 中 MVVM、MVC、MVP 模式的区别是什么？",
                link: "/daily-question/vue_20250903",
              },
              {
                text: "20250904_怎么在组件初始化时立即调用 Vue 的 watch 函数？",
                link: "/daily-question/vue_20250904",
              },
              {
                text: "20250905_什么是 vue 的单向数据流和双向数据流？",
                link: "/daily-question/vue_20250905",
              },
              {
                text: "20250906_什么是 vue 的自定义指令？自定义指令的应用场景有哪些？",
                link: "/daily-question/vue_20250906",
              },
              {
                text: "20250908_Vue Router 的核心实现原理是什么？",
                link: "/daily-question/vue_20250908",
              },
              {
                text: "20250915_为什么 Vue 使用异步的方式更新组件？",
                link: "/daily-question/vue_20250915",
              },
            ],
          },
          {
            text: "vue3",
            collapsed: true,
            items: [
              {
                text: "20250818_如何在 Vue3 中使用 defineAsyncComponent 实现异步组件加载？",
                link: "/daily-question/vue3_20250818",
              },
              {
                text: "20250819_什么是 Vue3 的 tree-shaking 特性？有什么作用？",
                link: "/daily-question/vue3_20250819",
              },
              {
                text: "20250820_Vue3 的 Fragment 是什么？有什么作用？",
                link: "/daily-question/vue3_20250820",
              },
              {
                text: "20250822_ Vue3 中的 Vue Composition API 是什么？",
                link: "/daily-question/vue3_20250822",
              },
              {
                text: "20250823_Vue3 性能提升主要体现在哪些方面？",
                link: "/daily-question/vue3_20250823",
              },
              {
                text: "20250824_vue3 使用的 DIFF 算法相比 vue3 的双端对比有什么优点？",
                link: "/daily-question/vue3_20250824",
              },
              {
                text: "20250825_Vue3 中的 watch 和 watchEffect 有什么区别？如何选择使用它们？",
                link: "/daily-question/vue3_20250825",
              },
              {
                text: "20250826_为什么 Vue3 中使用 Proxy API 代替了 Object.defineProperty API?",
                link: "/daily-question/vue3_20250826",
              },
              {
                text: "20250827_Vue3 的 Suspense 组件有什么作用？如何使用它来处理异步组件？",
                link: "/daily-question/vue3_20250827",
              },
              {
                text: "20250828_你如何在 Vue3 中管理全局状态？使用了哪些工具和方法？",
                link: "/daily-question/vue3_20250828",
              },
              {
                text: "20250830_Vue2 和 Vue3 有哪些区别？Vue3 有哪些更新？",
                link: "/daily-question/vue3_20250830",
              },
              {
                text: "20250831_如果要实现一个 Vue3 的弹窗组件，你会如何设计？",
                link: "/daily-question/vue3_20250831",
              },
            ],
          },
          {
            text: "typescript",
            collapsed: true,
            items: [
              {
                text: "20250907_Typescript 有哪些常用类型？",
                link: "/daily-question/ts_20250907",
              },
              {
                text: "20250914_什么是 Typescript 的对象类型？怎么定义对象类型？",
                link: "/daily-question/ts_20250914",
              },
              {
                text: "20250922_什么是 Typescript 的类型别名？怎么定义类型别名？",
                link: "/daily-question/ts_20250922",
              },
              {
                text: "20251010_什么是 Typescript 的接口？怎么定义接口？",
                link: "/daily-question/ts_20251010",
              },
              {
                text: "20251018_Typescript 的类型别名与接口有什么区别？",
                link: "/daily-question/ts_20251018",
              },
            ],
          },
          {
            text: "javascript",
            collapsed: true,
            items: [
              {
                text: "20250909_Javascript 有哪些数据类型？它们的区别是什么？",
                link: "/daily-question/js_20250909",
              },
              {
                text: "20250910_说说你对 fetch 的理解，它有哪些优点和不足？",
                link: "/daily-question/js_20250910",
              },
              {
                text: "20250916_Javascript 中 null 和 undefined 的区别是什么？",
                link: "/daily-question/js_20250916",
              },
              {
                text: "20250917_Javascript 中 Object.keys 的返回值是无序的吗？",
                link: "/daily-question/js_20250917",
              },
              {
                text: "20250920_一图读懂 Javascript 的原型链？",
                link: "/daily-question/js_20250920",
              },
              {
                text: "20250923_typeof 与 instanceof 有什么区别？",
                link: "/daily-question/js_20250923",
              },
              {
                text: "20250924_Javascript 的 BigInt 和 Number 类型有什么区别？",
                link: "/daily-question/js_20250924",
              },
            ],
          },
          {
            text: "es6",
            collapsed: true,
            items: [
              {
                text: "20250911_ES6 箭头函数和普通函数有什么区别？",
                link: "/daily-question/es6_20250911",
              },
              {
                text: "20250918_ES6 箭头函数能当构造函数吗？",
                link: "/daily-question/es6_20250918",
              },
              {
                text: "20250925_ES6 有哪些新特性？",
                link: "/daily-question/es6_20250925",
              },
            ],
          },
          {
            text: "css",
            collapsed: true,
            items: [
              {
                text: "20250912_有哪些 CSS 选择器？请分别介绍",
                link: "/daily-question/css_20250912",
              },
              {
                text: "20250919_如何计算 CSS 的优先级？",
                link: "/daily-question/css_20250919",
              },
              {
                text: "20250926_CSS 中可继承与不可继承属性有哪些？",
                link: "/daily-question/css_20250926",
              },
            ],
          },
          {
            text: "node",
            collapsed: true,
            items: [
              {
                text: "20250913_什么是 Node.js？它的主要特点是什么？适用于哪些场景？",
                link: "/daily-question/node_20250913",
              },
              {
                text: "20250921_如何在 Node.js 中创建一个简单的 HTTP 服务器？",
                link: "/daily-question/node_20250921",
              },
              {
                text: "20251009_Node.js 中如何导入和导出模块？",
                link: "/daily-question/node_20251009",
              },
            ],
          },
        ],
      },
      {
        text: "基础",
        collapsed: true,
        items: [
          {
            text: "Html&Css面试题",
            collapsed: true,
            items: [{ text: "html&css面试题", link: "/html&css/interview" }],
          },
          {
            text: "JavaScript",
            collapsed: true,
            items: [
              { text: "javascript基础知识", link: "/javascript/base" },
              { text: "javascript面试题", link: "/javascript/interview" },
              { text: "es6~es11基础知识", link: "/es6/base" },
              { text: "es6~es11面试题", link: "/es6/interview" },
            ],
          },
          {
            text: "Typescript",
            collapsed: true,
            items: [
              { text: "1.类型系统", link: "/typescript/types" },
              { text: "2.数组", link: "/typescript/array" },
              { text: "3.元组", link: "/typescript/tuple" },
              { text: "4.symbol", link: "/typescript/symbol" },
              { text: "5.函数", link: "/typescript/function" },
              { text: "6.对象", link: "/typescript/object" },
              { text: "7.接口", link: "/typescript/interface" },
              { text: "8.类", link: "/typescript/class" },
              { text: "9.泛型", link: "/typescript/generics" },
              { text: "10.枚举", link: "/typescript/enum" },
              { text: "11.类型断言", link: "/typescript/assert" },
              { text: "12.模块", link: "/typescript/module" },
              { text: "13.装饰器", link: "/typescript/decorator" },
              { text: "14.命名空间", link: "/typescript/namespace" },
              { text: "15.declare", link: "/typescript/declare" },
              { text: "16.类型声明文件", link: "/typescript/dts" },
              { text: "17.类型运算符", link: "/typescript/operator" },
              { text: "18.类型映射", link: "/typescript/mapping" },
              { text: "19.类型工具", link: "/typescript/utility" },
              { text: "20.注释指令", link: "/typescript/comment" },
              { text: "21.tsconfig.json", link: "/typescript/tsconfig" },
              { text: "22.tsc", link: "/typescript/tsc" },
            ],
          },
          {
            text: "Webpack",
            collapsed: true,
            items: [{ text: "webpack基础知识", link: "/webpack/base" }],
          },
          {
            text: "Flutter",
            collapsed: true,
            items: [
              { text: "flutter基础组件", link: "/flutter/base" },
              { text: "flutter生命周期", link: "/flutter/lifecycle" },
              { text: "flutter网络请求", link: "/flutter/http" },
              { text: "flutter缓存管理", link: "/flutter/cache" },
              { text: "flutter Getx", link: "/flutter/getx" },
              {
                text: "flutter_doc",
                link: "https://gitee.com/bidding-M/flutter_doc",
              },
              {
                text: "hi_bilibili",
                link: "https://gitee.com/bidding-M/hi_bilibili",
              },
            ],
          },
          {
            text: "uni-app",
            collapsed: true,
            items: [
              { text: "uni-app", link: "/uni-app/uni-app" },
              {
                text: "uni-app_component",
                link: "/uni-app/uni-app_component",
              },
              {
                text: "uni-app-x",
                link: "/uni-app/uni-app-x",
              },
              {
                text: "uni-app-x_uvue",
                link: "/uni-app/uni-app-x_uvue",
              },
              {
                text: "uni-app-x_uts",
                link: "/uni-app/uni-app-x_uts",
              },
              {
                text: "uni-app-x_component",
                link: "/uni-app/uni-app-x_component",
              },
              {
                text: "uni-app-x_api",
                link: "/uni-app/uni-app-x_api",
              },
              {
                text: "uni-app-x_global",
                link: "/uni-app/uni-app-x_global",
              },
              {
                text: "uni-app-x_css",
                link: "/uni-app/uni-app-x_css",
              },
            ],
          },
        ],
      },
      {
        text: "框架",
        collapsed: true,
        items: [
          {
            text: "Vue",
            collapsed: true,
            items: [
              { text: "vue基础知识", link: "/vue/base" },
              { text: "vue面试题", link: "/vue/interview" },
            ],
          },
          {
            text: "Vue3",
            collapsed: true,
            items: [
              { text: "vue3基础知识", link: "/vue3/base" },
              { text: "vue3面试题", link: "/vue3/interview" },
            ],
          },
          {
            text: "Vite",
            collapsed: true,
            items: [{ text: "vite基础知识", link: "/vite/base" }],
          },
          {
            text: "微前端",
            collapsed: true,
            items: [
              { text: "基础知识", link: "/micro-frontend/base" },
              { text: "无界", link: "/micro-frontend/wujie" },
              { text: "乾坤", link: "/micro-frontend/qiankun" },
              { text: "微前端", link: "/micro-frontend/micro-frontend" },
            ],
          },
          {
            text: "桌面端",
            collapsed: true,
            items: [{ text: "electron基础知识", link: "/desktop/electron" }],
          },
        ],
      },
      {
        text: "浏览器",
        collapsed: true,
        items: [
          { text: "浏览器基础知识", link: "/web/base" },
          { text: "浏览器面试题", link: "/web/interview" },
        ],
      },
      {
        text: "服务端",
        collapsed: true,
        items: [{ text: "node基础知识", link: "/node/base" }],
      },
      {
        text: "面试记录",
        collapsed: true,
        items: [{ text: "history first", link: "/records/record1" }],
      },
    ],
    socialLinks: [
      { icon: "gitee", link: "https://gitee.com/bidding-M/doc-web" },
    ],
    editLink: {
      pattern: "https://gitee.com/bidding-M/doc-web/blob/dev/docs/:path",
      text: "Edit this page on GitCode",
    },
    lastUpdated: {
      text: "Updated at",
      formatOptions: {
        dateStyle: "full",
        timeStyle: "short",
      },
    },
  },
  markdown: {
    image: {
      lazyLoading: true, // 开启所有图片懒加载
    },
    lineNumbers: true, // 开启代码块行号
  },
});
